<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			var max;
			var a=[2,8,21,74,100,99];
			for(var i=0;i<5;i++){	
				if(a[i]>a[i+1]){
					max=a[i];	
				}
				else{
					max=a[i+1];
				}
			}
			document.write(max);
			
		</script>
	</body>
</html>
